<?php
namespace Application\Repository;
use Doctrine\ORM\EntityRepository;

class CountryRepository extends AbstractRepository
{
    protected  $entity="Application\\Entity\\Country";
    
    public function getByCode($code)
    {
        $dql = "SELECT c FROM $this->entity c WHERE c.code=?1";

        return $this->getEntityManager()->createQuery($dql)
                             ->setParameter(1, $code)
                             ->getResult();
    }
}